package Demo01;


import java.io.*;
public class Demo01 {
    public static void main(String[] args) throws IOException {
       //创建高效的字节输入流对象和字节输出流对象
        //2. 通过字节输入流对象读取数据(一次读一个字节，一次读一个字节数组)，字节输出流对象写数据
        //3. 释放资源


        BufferedInputStream bufferedInputStream =new BufferedInputStream(new FileInputStream("C:\\Users\\Administrator\\Desktop\\上课代码ppt\\IO练习\\IO练习\\src\\Demo01\\Demo01.java"));
        BufferedOutputStream bufferedOutputStream = new BufferedOutputStream(new FileOutputStream("C:\\Users\\Administrator\\Desktop\\HMJavaEE-359-day11\\a.java"));

        byte[]bytes =new byte[1024];

        int len =-1;

        while ((len=bufferedInputStream.read(bytes))!=-1){

            bufferedOutputStream.write(bytes,0,len);
        }
        bufferedOutputStream.close();
        bufferedInputStream.close();

    }
}
